<script>
import api from "@/api";

export default {
  name: "index",
  data() {
    return {
      total: 0,
      tableData: [
        {
         name:"处罚信息",
          data:["市发展改革委",'市发展改革委',"市发展改革委",'市发展改革委',"市发展改革委",'市发展改革委',"市发展改革委",'市发展改革委']
        }
      ],
      currentTab: 1,
      queryParam: {
        searchType: "",
        keyword: "",
        type: "机构职能和设置",
        pageSize: 5,
        pageNum: 1
      }
    }
  },
  mounted() {
    (async () => {
      // await this.fetchData("财政决算")
    })()
  },
  methods: {
    async fetchData(type, index) {
      let data = await api.xing_zheng_gong_kai({...this.queryParam, type})
      this.tableData.push({
        name: type,
        data: data.records
      })
    },
    handleCurrentChange(size) {
      this.queryParam.pageNum = size
      this.fetchData()
    },
    handleSizeChange(size) {
      this.queryParam.pageSize = size
      this.fetchData()
    }
  }
}
</script>

<template>
  <el-row>
    <el-col v-if="false" :span="24">
      <div class="flex items-center">
        <el-select v-model="queryParam.searchType">
          <el-option value="" label="全部">全部</el-option>
          <el-option value="biao_ti" label="标题"></el-option>
          <el-option value="zheng_wen" label="正文"></el-option>
          <el-option value="wen_hao" label="文号"></el-option>
        </el-select>
        <el-input v-model="queryParam.keyword" placeholder="请输入关键字"></el-input>
        <el-button type="default" icon="el-icon-search"></el-button>
      </div>
    </el-col>
    <el-col :span="24" class="bg-white p-3" v-for="(_item,_index) in tableData" :key="index"
            v-if="_item&&_item.data&&_item.data.length>0">
      <div>
        <div class="px-3 py-2 bg-[#2d66a5] text-white inline-block">{{ _item.name }}</div>
      </div>
      <div style="display: flex;align-items: center;flex-wrap: wrap">
        <div v-for="(item,index) in _item.data" :key="index" style="flex: 0 0 33.3333%;padding: 20px 0">
          <div>{{item}}</div>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<style scoped>

</style>
